package com.huike.clues.service.impl;

import com.huike.clues.domain.SysDictType;
import com.huike.clues.mapper.SysDictTypeMapper;
import com.huike.clues.service.ISysDictService;
import com.huike.common.core.domain.entity.SysDictTypeDTO;
import com.huike.common.utils.SecurityUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class SysDictServiceImpl implements ISysDictService {

    @Autowired
    private SysDictTypeMapper sysDictTypeMapper;
    /**
     * 新增字典类型
     * @param sysDictTypeDTO
     */
    @Override
    public void addDictType(SysDictTypeDTO sysDictTypeDTO) {
        SysDictType sysDictType = new SysDictType();
        BeanUtils.copyProperties(sysDictTypeDTO, sysDictType);
        sysDictType.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
        sysDictTypeMapper.addDictType(sysDictType);
    }
}
